package com.itany.service;

import com.itany.vo.ResponseResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 * Author：汤小洋
 * Date：2023-01-03 9:37
 * Description：<描述>
 */
// @FeignClient(value = "user-provider", fallback = UserServiceFallback.class)
@FeignClient(value = "cloud-gateway", fallback = UserServiceFallback.class)
@Service
public interface UserService {

    @GetMapping("/users")
    public ResponseResult getUserList();

    @GetMapping("/users/{id}")
    public ResponseResult getUser(@PathVariable("id") Integer id); // 此处@PathVariable注解必须指定value

    @PostMapping("/users")
    public ResponseResult postUser(@RequestParam("username") String username, @RequestParam("password") String password);

    @DeleteMapping("/users/{id}")
    public ResponseResult deleteUser(@PathVariable("id") Integer id);

    @PutMapping("/users")
    public ResponseResult putUser(@RequestParam Map<String, Object> map);

}
